package problem.array;

public class problem11 {
	public static void main(String[] args) {
	
	}
	public static int maxArea(int[] height) {
		if(height== null || height.length <=1){
			return 0;
		}
		int i = 0;
		int j = height.length-1;
		int max = 0;
		while(i < j){
			int temp = (j-i)*Math.min(height[i], height[j]);
			max = Math.max(temp, max);
			if(height[i] < height[j]){
				i++;
			}else{
				j++;
			}
		}
		return max;
	}
}
